package com.wfh.rpc.registry;

import com.wfh.rpc.spi.SpiLoader;

/**
 * @Title: RegistryFactory
 * @Author wangfenghuan
 * @Package com.wfh.rpc.registry
 * @Date 2025/10/14 14:41
 * @description: 注册工厂类
 */
public class RegistryFactory {

    static {
        SpiLoader.load(Registry.class);
    }

    /**
     * 默认注册中心
     */
    private static final Registry DEFAULE_REGISTERY = new EtcdRegistry();

    /**
     * 获取实例
     * @param key
     * @return
     */
    public static Registry getInstance(String key){
        return SpiLoader.getInstance(Registry.class, key);
    }

}
